﻿#include <stdio.h>
int main()
{
	int a, b, c, i, n=0, m1, m2;
	int count = 0;
	scanf_s("%d", &n);
	for (a = 1; a <= 20; a++)
	{
		for (b = 1; b <= 33; b++)
		{
			for (c = 1; c <= 100; c++)
			{
				m1 = 5 * a + 3 * b + c;
				m2 = a + b + 3 * c;
				if (m1 == 100 && m2 == 100)
				{
					printf("%d %d %d\n", a, b, 3 * c);
					count++;
					if (count == n)
					{
						return 0;
					}
				}
			}
		}
	}
}